<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <button id="btn">test</button>
    <button id="btn2">根据游戏类型获取游戏</button>    
    <button id="btn">test</button>    
    <button id="btn">test</button>    
    <button id="btn">test</button>
    
    <form id="form1" enctype="multipart/form-data" >
        <div class="uploadBox">
            <a class="upload" href="javascript:void(0)">
                热门游戏：
                <input class="uploadBtn" id="uploadBtn" type="file" name="uploadBtn" />
            </a>
            <input id="avatar" type="text" value="/static/images/sample.png" name="avatar" style="width: 400px">
            <input class="uploadToServer" name="uploadToServer" id="uploadToServer" type="submit" value="上传">
            <img src="" alt="">
    </form>
</body>
<script src="https://code.jquery.com/jquery-3.3.1.js" ></script>
<script>
    $(function (params) {
        $("#btn").click(function (params) {
            console.log(22222);
            $.ajax({
                url: 'http://127.0.0.1:3000/game/list',
                // data: $(this).serialize(),
                type: 'get',
                dataType: 'json'
            })
                .then(function (results) {
                    console.log(results);
                    
                });
        })

        $("#btn2").click(function (params) {
            console.log(22222);
            $.ajax({
                url: 'http://127.0.0.1:3000/gametype',
                // data: $(this).serialize(),
                type: 'get',
                dataType: 'json',
                data:{type:1}
            })
                .then(function (results) {
                    console.log(results);
                    
                });
        })
    })

</script>

</html>
